<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>待付款</title>
    <script type="text/javascript" src="jquery-3.5.1.min.js"></script>
    <script>
      $(function () {
          setInterval(refreshTime, 1000);
      })

      let time = 10;

      function refreshTime() {
          if (time <= 0) {
              window.location.href = "/failureOrder/[(${orderId})]";
          }
          $("#time").text("剩余时间：" + time + "s")
          time -= 1;
      }

      function pay() {
        window.location.href = "/pay/[(${orderId})]";
      }
    </script>
</head>
<body>
  <p th:text="'订单号: ' + ${orderId}" />
  <span id="time"></span>
  <!--<button th:onclick="pay([[${orderNo}]])">付款</button>-->
  <a href="javascript:pay()">支付</a>
</body>
</html>